package com.sghd.candy.module.fight.facade;

import com.sghd.common.socket.anno.InBody;
import com.sghd.common.socket.anno.InSession;
import com.sghd.common.socket.anno.SocketCommand;
import com.sghd.common.socket.anno.SocketModule;
import com.sghd.pojo.candy.fight.EnterVo;
import com.sghd.pojo.candy.fight.dto.SettleTo;
import com.sghd.pojo.candy.fight.vo.ServerVo;
import com.sghd.pojo.fight.game.LevelVo;
import com.sghd.pojo.fight.game.SettleVo;

import static com.sghd.candy.utils.SocketEnum.*;
import static com.sghd.common.socket.session.SessionKeys.IDENTITY;
import static com.sghd.common.socket.session.SessionKeys.MANAGEMENT;

/**
 * 战斗模块
 * @author Allen
 * @date 2018/12/03
 */
@SocketModule()
public interface FightFacade {
    /**
     * 获取战斗服
     * @param playerId
     * @return
     */
    @SocketCommand(FIGHT_SERVER_INFO)
    ServerVo getServer(@InSession(IDENTITY)long playerId);

    /**
     * 关卡选择判断
     * @param playerId
     * @param levelVo
     * @return
     */
    @SocketCommand(FIGHT_LEVEL_SELECT)
    Integer levelSelect(@InSession(IDENTITY) long playerId, LevelVo levelVo);

    /**
     * 连接战斗服务器
     * @param ip
     * @param enterVo
     */
    @SocketCommand(FIGHT_CONN)
    void connect(@InSession(MANAGEMENT) String ip, EnterVo enterVo);

    /**
     * 战斗结算接口
     * @param ip
     * @param settleTo
     * @return
     */
    @SocketCommand(FIGHT_BATTLE_SETTLE)
    SettleVo settlement(@InSession(MANAGEMENT) String ip, SettleTo settleTo);

    /**
     * 断开战斗服务器
     * @param ip
     * @param playerId
     */
    @SocketCommand(FIGHT_DISCONN)
    void disConnect(@InSession(MANAGEMENT) String ip, @InBody("playerId") long playerId);

    /**
     * 取消重连标识
     * @param ip
     * @param playerId
     */
    @SocketCommand(FIGHT_CANCEL_RECONN)
    void cancelReConn(@InSession(MANAGEMENT) String ip, @InBody("playerId") long playerId);
}
